package com.jason.basicandroid.ui;

//import android.R;
import android.app.ListActivity;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.ContactsContract.Contacts;
import android.provider.ContactsContract.PhoneLookup;
import android.widget.SimpleCursorAdapter;

public class ListViewControl1 extends ListActivity {
    private SimpleCursorAdapter adapter;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        Cursor c = getContentResolver().query(
        		Contacts.CONTENT_URI, null, null, null, null);
        startManagingCursor(c);
        
        String[] cols = new String[]{PhoneLookup.DISPLAY_NAME};
        int[] names = new int[]{R.id.row_tv};
        adapter = new SimpleCursorAdapter(this,R.layout.list_item,c,cols,names);
        
        setListAdapter(adapter);
    }
}